package org.cskt.sl.sys.service.impl;

import java.util.List;

import org.cskt.sl.sys.dao.ComboMapper;
import org.cskt.sl.sys.entity.Combo;
import org.cskt.sl.sys.example.ComboExample;
import org.cskt.sl.sys.service.ComboService;
import org.cskt.sl.util.Pager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ComboServiceImpl implements ComboService {
	
	@Autowired
	private ComboMapper comboMapper;
	

	@Override
	public int countByExample(ComboExample example) {
		// TODO Auto-generated method stub
		return comboMapper.countByExample(example);
	}

	@Override
	public int deleteComboById(Integer cid) {
		// TODO Auto-generated method stub
		return comboMapper.deleteByPrimaryKey(cid);
	}

	@Override
	public int addCombo(Combo record) {
		// TODO Auto-generated method stub
		return comboMapper.insertSelective(record);
	}

	@Override
	public List<Combo> findComboPageList(ComboExample example, Pager pager) {
		// TODO Auto-generated method stub
		return comboMapper.selectByExample(example, (pager.getCurrentPage() - 1) * pager.getPageSize(), pager.getCurrentPage()*pager.getPageSize());
	}

	@Override
	public int updateComboById(Combo record) {
		// TODO Auto-generated method stub
		return comboMapper.updateByPrimaryKey(record);
	}

	@Override
	public Combo getComboById(Integer cid) {
		// TODO Auto-generated method stub
		return comboMapper.selectByPrimaryKey(cid);
	}

}
